package net.portly.cst.page;

import java.util.HashMap;
import java.util.Map;

import net.portly.cst.AssetTypeDescriptor;
import net.portly.cst.MetaAssetContainer;
import net.portly.cst.flex.FlexItemType;

public class PageAssetsContainer extends MetaAssetContainer {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private Map<FlexItemType, AssetTypeDescriptor> assetTypeDescriptors = new HashMap<FlexItemType, AssetTypeDescriptor>();;
	
	public void add(AssetTypeDescriptor atd) {
		assetTypeDescriptors.put(atd.getWhatTypeOfFlexItem(), atd);
	}
	
	public AssetTypeDescriptor getPageAttribute() {
		return assetTypeDescriptors.get(FlexItemType.PAGEATTR);
	}
	
	public AssetTypeDescriptor getPageFilter() {
		return assetTypeDescriptors.get(FlexItemType.PAGEFILTER);
	}
	
	public AssetTypeDescriptor getPageDef() {
		return assetTypeDescriptors.get(FlexItemType.PAGEDEF);
	}


	public String toString() {
		return "Page: [ " + "\n  " + toStringForAllForStructuralFlexItem(FlexItemType.PAGEATTR, "PageAttr: ") + "\n  "
				+ toStringForAllForStructuralFlexItem(FlexItemType.PAGEFILTER, "Filter: ") + "\n  "
				+ "\n  " + toStringForAllForStructuralFlexItem(FlexItemType.PAGEDEF, "PageDef: ") + "\n]";
	}

	@Override
	public String getFamilyName() {
		return "Page";
	}
}
